<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/pages/login/common.jsp" %>
<%
String path = request.getContextPath();
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>订阅卡管理</title>
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/global.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/include/css/style.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/btn.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/themes.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/proManage.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/page.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/include/css/mmt_trading.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/include/pagination/page.css" media="all">
<link rel="stylesheet" type="text/css" href="<%=path %>/include/sweetalert/sweetalert.css" />
<script type="text/javascript" src="<%=path %>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/icss.common.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/cookies.js"></script>
<script type="text/javascript" src="<%=path%>/include/pagination/jquery.pagination.js"></script>
<script type="text/javascript" src="<%=path%>/include/pagination/init.js"></script>
<script type="text/javascript" src="<%=path %>/include/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="<%=path %>/include/sweetalert/sweetalert-dev.js"></script>

<style type="text/css">
#listTable td{
  font-size:12px;
  border: 1px solid #ddd;
  padding: 4px;
}
input{border-radius: 4px;}
h2{
width:480px;
}
.noborder{border:none;height:2px;overflow:hidden;}
.noborder td{height: 2px;}
#listTable th{
   border: 1px solid #ddd;
   font-weight: bold;
  
}
.saveButton{
    width:44px;
    height:24px;
    line-height:24px;   
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: 0 -203px;
    border:0;
    cursor:pointer;
    font: 12px/1.5 arial,tahoma,\5b8b\4f53;
    margin: 0 0 0 5px;
    outline:none;
    background-image: url('<%=path%>/include/css/img/xs_bgx.png');   
}
</style>
<script type="text/javascript">
	$(function(){
		_queryList();
	})
	//查询订阅卡列表
	var pagination;
	function _queryList(){
		var url = "<%=path %>/orderList/queryCardList.do";
		var data = {
				cardNo : $("#cardNo").val(),
				status : $("#status").val()
		};
  		pagination = _initPagination({'pageId':'pagination', 'cKey':'toVehicleList','url': url,'data': data,'rows': 10, 'callback':_initDataList});
	}
	function _initDataList(data) {
	 		var d = data.rows;
	 		var total = data.total;
			var str = "";
			$("#list_tbody").empty();
			for(var i=0;i<d.length;i++){
				str += "<tr class='list_table_tr'>";
				str += "    <td class='span5' style='text-align:center;vertical-align: middle'>"+d[i].PID+"</td>";
				str += "    <td class='span10' style='text-align:center;vertical-align: middle'>"+d[i].CARD_NO+"</td>";
				str += "    <td class='span10' style='text-align:center;vertical-align: middle'>";
				if(d[i].STATUS=='1'){
					str += "    <span style='color:#CD0000;'>"+d[i].STATUS_NAME+"</span>";
				}else if (d[i].STATUS=='2'){
					str += "    <span style='color:#699f00;'>"+d[i].STATUS_NAME+"</span>";
				}else {
					str += d[i].STATUS_NAME;
				}
				str += "    </td>";
				str += "    <td class='span15' style='text-align:left;vertical-align: middle'>"+d[i].USE_TIME_STR+"</td>";
				str += "    <td class='span15' style='text-align:left;vertical-align: middle'>"+d[i].USER_NAME+"</td>";
				str += "    <td class='span15' style='text-align:left;vertical-align: middle'>"+d[i].ORDER_NO+"</td>";
				str +=" </tr>";
			}
			if(str == ''){
				str += "<tr>";
				str += "	<td colspan='6' style='text-align:center'>暂无数据</td>";
				str += "</tr>";
			}
			$("#list_tbody").append(str);
			_reHeight("rightFrame", "contentDiv");
	 }
</script>
</head>
<body style="font-family: '微软雅黑';padding: 0px;">
	<div id="contentDiv" style="padding:5px; width:99%;margin-left: 0px;">
 		<div style="width:100%;height:30px;border-bottom:1px solid #ADADAD;margin-bottom: 15px;">
	      	<div class="toptil">订阅卡管理
			</div>
	    </div>
		<div class="appeal_s" style="float:none;width: 100%;margin: 0px;padding: 10px 0px;">
			<form id="fm" name="fm" method="post" action="" novalidate="novalidate">
				<span style="padding-left:6px;">卡号：</span><input type="text" class="input-medium" style="height: 24px;width: 160px;" name="cardNo" id="cardNo"/>
				&nbsp;状态:&nbsp;
					<select id="status" name="status" style="width: 80px;height: 24px;">
						<option value="">全部</option>
						<option value="0">未使用</option>
						<option value="1">使用中</option>
						<option value="2">已使用</option>
					</select>
                 <button  type="button" class="saveButton" onclick="_queryList()">查询</button>
			</form>
		</div>
		<div class="row-fluid dataTables_wrapper" style="margin-top: 15px;" >
			<table id="listTable" class="table table-hover table-nomargin table-bordered usertable dataTable"
			style="width: 100%; border-spacing: 0;">
				<thead>
					<tr class="trBgd" style="background-color: #eee;text-align: center; height: 31px; border: 1px solid #ddd; white-space: nowrap; background-position: 0 -123px; line-height: 30px; font-weight: bold;">
						<th class="span5" nowrap>序号</th>
						<th class="span10" nowrap>卡号</th>
						<th class="span15" nowrap>状态</th>
						<th class="span10" nowrap>使用时间</th>
						<th class="span10" nowrap>使用人</th>
						<th class="span10" nowrap>订单号</th>
					</tr>
				</thead>
				<tbody id="list_tbody" style="font-size: 13px">
				</tbody>
			</table>
			<div class="dataTables_paginate paging_full_numbers">
				<span id="innerHtml"> </span>
			</div>
			<div id="pagination"></div>
			<div>
				<div style="height: 30px;"></div>
				<div class="clear"></div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function(){
		_reHeight();
	});
	function _reHeight(){
		var main = $(window.parent.document).find("#rightFrame");
		var mainheight = $("#contentDiv").height();
		main.height(mainheight);
	}

</script>
</html>
